#include "TesPch.h"
#include "TesLexLocation.h"


const TesLexLocation TesLexLocation::InvalidLocation( -1, -1 );


TesLexLocation::TesLexLocation( const TesLexLocation & location )
	: mLine( location.GetLine() )
	, mColumn( location.GetColumn() )
	, mFilename( location.GetFilename() )
{
}


TesLexLocation::TesLexLocation( int line, int column, const tstring & filename )
	: mLine( line )
	, mColumn( column )
	, mFilename( filename )
{
}


TesLexLocation & TesLexLocation::operator=( const TesLexLocation & rhs )
{
	mLine = rhs.mLine;
	mColumn = rhs.mColumn;
	mFilename = rhs.mFilename;
	return *this;
}


tstring TesLexLocation::ToString() const
{
	tstringstream ret;
	ret << t("(Ln.") << mLine;
	ret << t(", ");
	ret << t("Col.") << mColumn;
	ret << t(")");
	return ret.str();
}